/////////////////////////////////////////////////////////////////////////////
/*/	
 *	Creator:		Michael Duff
 *	Title:			
 *	Last Edited:	06/17/2013
 *	Summary:		
/*/
/////////////////////////////////////////////////////////////////////////////
#ifndef CENTITYMANAGER_H
#define CENTITYMANAGER_H

#include "BaseUnit.h"
#include "Base.h"
#include "PlayerShip.h"
#include "Barracks.h"
#include "Crate.h"
#include "Bullet.h"
#include "Listener.h"
#include <vector>
using namespace std;

class CEntityManager : public CListener
{
public:
	static CEntityManager* GetInstance( void );
	static void DeleteInstance( void );
	void AddEntity( CMovingObject* ptr );
	void AddEntity( CPlayerShip* ptr );
	void AddEntity( CBarricade* ptr );
	void AddEntity( CBase* ptr );
	void AddEntity( CCrate* ptr );
	void RemoveEntity( CMovingObject* ptr );
	void RemoveEntity( CPlayerShip* ptr );
	void RemoveEntity( CBarricade* ptr );
	void RemoveEntity( CBase* ptr );
	void RemoveEntity( CCrate* ptr );
	void Update(float dT);
	void Render(void);
	void Clear(void);
	int FindUnit( CMovingObject* unit);
	virtual void HandleEvent( Event* pEvent ) override;private:
	CEntityManager(void);
	~CEntityManager(void);
	CEntityManager( const CEntityManager& );
	CEntityManager& operator= ( const CEntityManager& );
	void CheckCollision();
	static CEntityManager* s_pInstance;
	bool m_bIterating;
public:
	vector<CMovingObject*> m_BaseUnits;
	vector<CCrate*> m_Crates;
	vector<CBarricade*> m_Barricades;
	vector<CPlayerShip*> m_PlayerShips;
	vector<CBase*> m_Bases;
};
#endif